package com.zy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.entity.Schedule;
import com.zy.mapper.ScheduleMapper;
import com.zy.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements ScheduleService {
    @Autowired
    ScheduleMapper scheduleMapper;
    /**
     * 根据用户id获取用户所有的日程
     * @param id
     * @return
     */
    @Override
    public List<Schedule> getScheduleByUserId(Integer id,String date) {
        return scheduleMapper.selectScheduleByUserId(id,date);
    }

    /**
     * 添加日程
     * @param schedule
     * @return
     */
    @Override
    public Integer addSchedule(Schedule schedule) {
        return scheduleMapper.addSchedule(schedule);
    }
}
